//
//  Config.h
//  iOSProjectExtension
//
//  Created by Apple on 2020/1/8.
//  Copyright © 2020 lidianchao. All rights reserved.
//

#ifndef Config_h
#define Config_h

#import "DeviceConfig.h"
#import "ViewConfig.h"
#import "ApiConfig.h"
#import "FontConfig.h"
#import "ColorConfig.h"
// 时间戳
#define RecordTime [[NSDate date] timeIntervalSince1970]
//防止循环引用，弱化对象
#define WS(weakSelf,object) typeof(object) __weak weakSelf = object
#define SS(strongSelf,object) typeof(object) strongSelf = object;


#define stringWithKey(key, comment) \
[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"] ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:@"InfoPlist"]
//测试模式下打印，其中包含行数等信息便于调试
#if DEBUG
#define NSLog(FORMAT, ...) fprintf(stderr, "\nfile:%s function:%s line:%d content:%s\n",                      \
[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], \
__FUNCTION__, __LINE__,                                                    \
[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(FORMAT, ...) nil
#endif


/**
 *  正常
 *
 *  @param >.0 用于区分9和8
 */
#define RGB0X(hexValue) [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16)) / 255.0 green:((float)((hexValue & 0xFF00) >> 8)) / 255.0 blue:((float)(hexValue & 0xFF)) / 255.0 alpha:1.0f]
#define kFontNameLight  ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0 ) ? @"PingFangSC-Regular" : @"Helvetica"
//粗体
#define kFontNameBold  ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0 ) ? @"PingFangSC-Semibold" : @"Helvetica-Bold"
//细体
#define kFontNameNomal  ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0 ) ? @"PingFangSC-Regular" : @"Helvetica-Light"


#endif /* Config_h */
